﻿using INTEX.DataBase;
using INTEX.DataBase.Tools;
using ReflectionStudio.Core.Events;
using System;
using System.Collections.Generic;
using System.Data;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{

    public class JLTVKHLData : BaseFunction
    {
        public bool checkVK07 = true;
        SETINTEXDB INTEXDB = new SETINTEXDB();
        public ApplicationBase app
        {
            get
            {
                return ApplicationBase.Instance;
            }
        }
        public INTEXDBC INTEXDBC
        {
            get
            {
                return app.INTEXDBC;
            }
        }
        public INTEXBL INTEXBL
        {
            get
            {
                return app.INTEXBL;
            }
        }
        public JLTVKHLData()
            : base()
        {
            Helper.GetDate(ref date, ref year, ref month, ref day);
        } 
        public DataSet BuildData(string client, string KRS, string LFD)
        {
            DataSet SReturn = new DataSet();
            DataSet SResult = new DataSet();

            try
            {
                SResult = INTEXBL.QueryVKK(MANDANT, KRS, LFD);
                SReturn.Merge(SResult);
            }
            catch (Exception ex)
            {
                Tracer.Error(ABPOS + ex.StackTrace, ex);
            }
            finally
            {
                EventDispatcher.Instance.RaiseStatus("查询完成", StatusEventType.StopProgress);
            }
            return SReturn;
        }
        public string Today
        {
            get
            {
                DateTime now = System.DateTime.Now;
                string year = now.Year.ToString();
                string m =Right("00" +now.Month.ToString(),2);
                string day = Right("00" +now.Day.ToString(),2);
                return year + m + day;
            }
        } 
    }
}